﻿<%@ Control Language="C#" EnableViewState="true" %>
<%@ Register Assembly="Antu.WebControls" Namespace="Antu.WebControls" TagPrefix="CBW" %>
<script language="javascript" type="text/javascript">
    var selectArray = new Array();

    function SelectAll(isSelectAll) {
        var element = document.getElementsByTagName("input");
        selectArray.length = 0;

        for (var i = 0; i < element.length; i++) {
            if (element[i].type == "checkbox") {
                element[i].checked = isSelectAll;

                if (isSelectAll)
                    selectArray.push(element[i].id);
            }
        }
    }
    function DeleteData() {
        var element = document.getElementsByTagName("input");
        selectArray.length = 0;

        for (var i = 0; i < element.length; i++) {
            if (element[i].type == "checkbox" && element[i].checked) {
                selectArray.push(element[i].id);
            }
        }
        if (selectArray.length > 0) {
            confirm("确认删除该条数据吗？");
            return true;
        }
        else { return false; }
    }
    function select_project(type) {
        var url = 'ZS_SelectProject.aspx?TYPE=' + type + '&rdm=' + Math.random();
        var feature = "dialogWidth:" + 710 + "px;dialogHeight:" + 530 + "px;scroll:yes;status:no;help:no;center:1";

        var project_info = window.showModalDialog(url, '', feature);

        if (project_info != undefined && project_info.length > 1) {
            if (type == "xzxc") {
                document.getElementById('<%=CQ_ITEM_ID.ClientID %>').value = project_info[1];
                document.getElementById('<%=ZSSSDW.ClientID %>').value = project_info[2];
                document.getElementById('<%=xkzh.ClientID %>').value = project_info[3];
                document.getElementById('<%=PGJG.ClientID %>').value = project_info[4];
            }
            if (type == "khyh") {
                document.getElementById('<%=KHYH.ClientID %>').value = project_info[1];
            }
        }
    }
    function CheckNull() {
        var tt1 = document.getElementById('<%=CQ_ITEM_ID.ClientID %>').value;
        var tt2 = document.getElementById('<%=KHYH.ClientID %>').value;
        if (tt1 == null || tt1 == "") {
            alert('请选择项目信息！');
            return false;
        } else if (tt2 == null || tt2 == "") {
            alert('请选择开户银行！');
            return false;
        } else {
            return true;
        }
    }
    function getdata() {
        var gdview = document.getElementById('<%=CustomGridView1.ClientID %>');
        var element = document.getElementsByTagName("input");
        var sum = 0;
        var sum1 = 0;
        var sum2 = 0;
        var checked_counts = 0;
        for (var i = 0; i < element.length; i++) {
            if (element[i].type == "checkbox" && element[i].checked) {
                var j = i + 1;
                var rowIndex = element[j].parentNode.parentNode.rowIndex;
                var value = gdview.rows(rowIndex).cells(5).innerText;
                var value1 = gdview.rows(rowIndex).cells(6).innerText;
                var value2 = gdview.rows(rowIndex).cells(7).innerText;
                if (isNaN(parseFloat(value))) { value = 0; }
                if (isNaN(parseFloat(value1))) { value1 = 0; }
                if (isNaN(parseFloat(value2))) { value2 = 0; }
                sum += parseFloat(value);
                sum1 += parseFloat(value1);
                sum2 += parseFloat(value2);
                checked_counts++;
            }
        }
        sum = sum.toFixed(2);
        sum1 = sum1.toFixed(2);
        sum2 = sum2.toFixed(2);
        if (checked_counts != 0) {
            document.getElementById('<%=Label3.ClientID %>').innerHTML = "合计到账金额：" + sum + " 元 ";
            document.getElementById('<%=Label4.ClientID %>').innerHTML = "合计划转金额：" + sum1 + " 元 | ";
            document.getElementById('<%=Label5.ClientID %>').innerHTML = "合计余额：" + sum2 + " 元";
            document.getElementById('<%=Label6.ClientID %>').innerHTML = "项目总数：" + checked_counts + " 个 | ";
        } else {
            document.getElementById('<%=Label3.ClientID %>').innerHTML = "";
            document.getElementById('<%=Label4.ClientID %>').innerHTML = "";
            document.getElementById('<%=Label5.ClientID %>').innerHTML = "";
            document.getElementById('<%=Label6.ClientID %>').innerHTML = "";
        }
    }
    function khsq(bcid, pid) {
        var url = 'ZJ_KHSQPage.aspx?fromsrc=zjk&bcid=' + bcid + '&pid=' + pid + '&rdm=' + Math.random();
        var feature = "dialogWidth:" + 710 + "px;dialogHeight:" + 530 + "px;scroll:yes;status:no;help:no;center:1";
        var pinfo = window.showModalDialog(url, '', feature);
        if (pinfo == "1") {
                window.location.href('CompensationBasicInIframe.aspx?ID=' + bcid + '&PID=' + pid + '');
            }
    }
</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-image: url(<%= Antu.Core.Components.SiteSettings.DefaultSiteSettings.DefaultThemeFolderMapPath %>images/menuthb.png);
    margin-top: 1px">
    <tr>
        <td valign="middle" height="30">
            <font id="Font1" style="font-size: 14px; font-weight: bold; color: #3E7CC3; float: left;
                color: black; text-indent: 1em;" runat="server">补偿款基本情况 </font>
        </td>
    </tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" align="center" class="window_tab_list"
    style="width: 98%; margin: 20px 0 10px 0; line-height: 35px; text-align: center;">
    <tr style="height: 30px;">
        <td style="width: 76px; text-align: right;">
            立项号:
        </td>
        <td style="width: 265px">
            <asp:TextBox ID="CQ_ITEM_ID" runat="server" Width="70%"></asp:TextBox>
            <input type="button" value="选择" onclick="select_project('xzxc');" />
        </td>
        <td style="width: 126px; text-align: right;">
            征收决定号:
        </td>
        <td>
            <asp:TextBox ID="xkzh" runat="server" Width="200px"></asp:TextBox>
        </td>
        <td style="width: 126px; text-align: right;">
            征收实施单位:
        </td>
        <td>
            <asp:TextBox ID="ZSSSDW" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>
    <tr style="height: 30px;">
        <td style="width: 76px; height: 21px; text-align: right;">
            开户银行:
        </td>
        <td style="height: 21px; width: 265px;">
            <asp:TextBox ID="KHYH" runat="server" Width="70%"></asp:TextBox>
            <input type="button" value="选择" onclick="select_project('khyh');" />
        </td>
        <td style="width: 126px; height: 21px; text-align: right;">
            银行账号:
        </td>
        <td style="height: 21px">
            <asp:TextBox ID="YHZH" runat="server" Width="200px"></asp:TextBox>
        </td>
        <td style="width: 126px; text-align: right;">
            评估机构:
        </td>
        <td style="width: 265px">
            <asp:TextBox ID="PGJG" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>
    <tr style="height: 30px;">
        <td style="width: 76px; height: 21px; text-align: right;">
            区属:
        </td>
        <td style="height: 21px">
            <asp:DropDownList ID="DropDownList1" runat="server">
            </asp:DropDownList>
        </td>
        <td style="height: 21px; text-align: right;">
            报结情况:
        </td>
        <td style="height: 21px">
            <asp:DropDownList ID="DropDownList2" runat="server">
            </asp:DropDownList>
        </td>
        <td align="right">
            年份:
        </td>
        <td>
            <asp:TextBox ID="TextBox1" runat="server" Width="80px"></asp:TextBox>
            <asp:Label ID="Label2" runat="server" Text="格式如:2012" ForeColor="Gray"></asp:Label>
        </td>
    </tr>
    <tr style="height: 30px;">
        <td align="center" colspan="6">
            <asp:Button ID="bt_query" runat="server" Text="查询" />
            <asp:Button ID="btnAdd" runat="server" Text="新增" Visible="false" />
            <asp:Button ID="bt_huazhuan" runat="server" Text="划转统计" />
            <asp:Button ID="bt_daozhang" runat="server" Text="到帐统计" />
            <asp:Button ID="btn_yinhang" runat="server" Text="银行汇总" />
            <input id="Button2" type="button" value="重置" onclick="javascript:window.location.href=location.href;" />
        </td>
    </tr>
</table>
<CBW:CustomGridView ID="CustomGridView1" runat="server" AutoGenerateDeleteConfirm="True"
    CustomSortExpression="" PageSize="10" CssClass="window_tab_list" AllowPaging="True"
    ShowGridViewSelect="MultiSelect" ShowHideColModel="None" HideTextLength="15"
    ShowCmpAndCancel="False" AutoGenerateColumns="False" CustomGridViewClass="window_tab_list_fst">
    <PagerSettings Visible="False" />
    <Columns>
        <asp:TemplateField Visible="false">
            <ItemTemplate>
                <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("ID") %>' />
                <asp:HiddenField ID="HiddenField2" runat="server" Value='<%# Eval("PNID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="立项号" HeaderText="立项号" ItemStyle-Width="100px"></asp:BoundField>
        <asp:BoundField DataField="立项号" HeaderText="征收决定号" Visible="false"></asp:BoundField>
        <asp:BoundField DataField="项目名称" HeaderText="项目名称"></asp:BoundField>
        <asp:BoundField DataField="开户银行" HeaderText="开户银行"></asp:BoundField>
        <asp:BoundField DataField="概算总金额" HeaderText="概算总金额(元)" HtmlEncode="False" />
        <asp:BoundField DataField="到账金额" HeaderText="总到账金额(元)" HtmlEncode="False" />
        <asp:BoundField DataField="划转金额" HeaderText="总划转金额(元)" HtmlEncode="False" />
        <asp:BoundField DataField="余额" HeaderText="余额(元)" HtmlEncode="False" />
        <asp:TemplateField HeaderText="操作">
            <ItemTemplate>
                <%--<a href='CompensationBasicInIframe.aspx?ID=<%#Eval("ID") %>&PID=<%#Eval("PNID") %>'>
                    开户</a>--%>
                    <span style="color:Blue; cursor:pointer" onclick="javascript:khsq('<%#Eval("ID") %>','<%#Eval("PNID") %>');">开户</span>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="项目信息">
            <ItemTemplate>
                <a href='ZJ_BCKJBInfo.aspx?ID=<%#Eval("ID") %>&PID=<%#Eval("PNID") %>'>
                    <asp:Label ID="Label7" runat="server" Text="查看"></asp:Label></a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="报结情况">
            <ItemTemplate>
                <asp:Button runat="server" ID="btn_tj" Text="完成" Enabled="false" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="报结状态" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button runat="server" ID="btn_tj2" Text="撤销" Enabled="false" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</CBW:CustomGridView>
<table border="1" width="97%" cellpadding="0" cellspacing="0" class="window_tab_list">
    <tr style="height: 30px;">
        <td align="left" colspan="4" style="height: 30px;">
            &nbsp; <span style="background-color: Yellow;">&nbsp;&nbsp;</span><span style="font-size: 12px;">此为提醒开户项目</span>
            <span style="background-color:#BBE1F8;">&nbsp;&nbsp;</span><span style="font-size: 12px;">此为已申请开户项目</span>
            <span style="background-color: #FE6501;">&nbsp;&nbsp;</span><span style="font-size: 12px;">余额已低于警戒值</span>
            <span style="background-color: Red;">&nbsp;&nbsp;</span><span style="font-size: 12px;">账户余额为0</span>
            <span style="font-size: 12px; color: Red;">余额已低于警戒值修改为正常时加标记： </span><span><font
                color='#FE6501'>★</font></span> <span style="font-size: 12px; color: Red;">账户余额为0修改为正常时加标记：
                </span><span><font color='Red'>◆</font></span>
            <asp:Label ID="Label1" runat="server" Text="" ForeColor="Red" Font-Size="12px"></asp:Label>
        </td>
    </tr>
    <tr>
        <td align="center" colspan="4">
            <asp:Button ID="bt_all" runat="server" Text="全选" OnClientClick="SelectAll(true);return false;" />&nbsp;
            <asp:Button ID="bt_cancel" runat="server" Text="取消" OnClientClick="SelectAll(false);return false;" />&nbsp;
            <input id="Button1" type="button" value="汇总" onclick="getdata()" />
        </td>
    </tr>
    <tr style="height: 30px;">
        <td colspan="6" style="text-align: center">
            <asp:Label ID="lbXmNum" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="lbdzje" runat="server" Text="" ForeColor="Red"></asp:Label>
            <br />
            <asp:Label ID="lbhzje" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="lbye" runat="server" Text="" ForeColor="Red"></asp:Label>
        </td>
    </tr>
    <tr style="height: 30px;">
        <td colspan="6" style="text-align: center">
            <asp:Label ID="Label6" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="Label3" runat="server" Text="" ForeColor="Red"></asp:Label><br />
            <asp:Label ID="Label4" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="Label5" runat="server" Text="" ForeColor="Red"></asp:Label>
        </td>
    </tr>
</table>
